<?php
namespace UHU\WebComic\Parser;
class RegEx extends \UHU\WebComic\Parser
{
	protected function nab()
	{
		if(preg_match_all('/' . $this->the_regex() . '/i',parent::nab(),$matches) != false)
		{
			$matches = array_unique($matches[1]);
			rsort($matches);
			$matches = array_slice($matches,0,static::max_items);
			return $matches;
		}
		else
		{
			throw new \RuntimeException('RegEx failed to find entries.');
		}
	}
	protected function the_regex()
	{
		return static::regex;
	}
}
?>